<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ca="http://java.sun.com/jsf/composite/cashSummery"                
                xmlns:pe="http://primefaces.org/ui/extensions">

    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <h:form id="panelPrint" styleClass="noBorder summeryBorder">

            <p:panel>
                <f:facet name="header" >
                    <h:outputLabel value="Book Keeping Summary Without Pro (DAY - CREDIT)"  styleClass="noPrintButton" />
                    <p:commandButton value="Refresh" ajax="false"  styleClass="noPrintButton" style="float: right;"
                                    action="#{bookKeepingSummery.createCashCategoryWithoutProDay}"/>

                    <p:commandButton ajax="false" value="Print"  styleClass="noPrintButton" style="float: right;" >
                        <p:printer target="panelPrint" />
                    </p:commandButton>
                    <p:commandButton value="Excel" ajax="false" styleClass="noPrintButton" style="float: right;">
                        <pe:exporter type="xlsx" target="
                                     opd,outSide,
                                     pharmacy,inward,
                                     agent,creditCompany,
                                     col,card,
                                     slip,cheque,
                                     finalSum" 
                                     fileName="Book_Keeping_Summery_without_pro_day"
                                     facetFontStyle="BOLD"   cellFontStyle="NORMAL"  
                                     fontName="Courier New"  />
                    </p:commandButton>

                    <h:panelGrid columns="6"  styleClass="noPrintButton" style="min-width: 100%;" >
                        <h:outputLabel value="From Date"/>
                        <p:calendar id="frmDate" value="#{bookKeepingSummery.fromDate}" navigator="true"  pattern="dd MM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel value="To Date"/>
                        <p:calendar id="toDate" value="#{bookKeepingSummery.toDate}" navigator="true" pattern="dd MM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel value="Select Institution"/>

                        <p:autoComplete completeMethod="#{institutionController.completeCompany}" required="true" 
                                        forceSelection="true"
                                        requiredMessage="Please Select Institution" value="#{bookKeepingSummery.institution}"
                                        var="pta" itemLabel="#{pta.name}" itemValue="#{pta}" />
                    </h:panelGrid>

                </f:facet>
            </p:panel>
            <!--            <p:spacer height="30" />-->

            <p:dataTable id="opd"  value="#{bookKeepingSummery.opdList}" var="d" 
                         rendered="#{bookKeepingSummery.opdList.size()>0}" 
                         paginator="false"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15,20">                   
                <f:facet name="header">
                    <h:panelGrid columns="2" styleClass="printBlock" style="min-width: 100%;">
                        <p:outputLabel value="#{sessionController.institution.name}"/><h:outputLabel/>
                        <p:outputLabel value="Book Keeping Summary"/><h:outputLabel/>   
                        <h:outputLabel/><h:outputLabel/>
                        <h:panelGroup>
                            <h:outputLabel value="From : "  />
                            <h:outputLabel  value="#{bookKeepingSummery.fromDate}" >
                                <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                            </h:outputLabel>
                        </h:panelGroup>
                        <h:panelGroup>
                            <h:outputLabel value="To : "/> 
                            <h:outputLabel  value="#{bookKeepingSummery.toDate}" style="float: right" >
                                <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                            </h:outputLabel>
                        </h:panelGroup>
                    </h:panelGrid>
                    <h:outputLabel value="OPD Service"/>     

                </f:facet>  

                <p:column headerText="Item Name" style="text-align: left;">
                    <h:outputLabel value="#{d.string}" rendered="#{d.summery eq false}" />
                    <h:outputLabel value="#{d.string}" rendered="#{d.summery eq true}" style="font-weight: bold;" />
                </p:column>   
                <p:column/>
                <p:column headerText="Count">
                    <h:outputLabel value="#{d.value1}" rendered="#{d.summery eq false}" />
                </p:column>
                <p:column style="text-align: right;"  headerText="Hospital Fee">                               
                    <h:outputLabel value="#{d.value2}" rendered="#{d.summery eq false}" >
                        <f:convertNumber pattern="#,##0.00"/>
                    </h:outputLabel>


                </p:column>    
                <p:column headerText="Sub Total" style="text-align: right;">
                    <h:outputLabel value="#{d.value2}" rendered="#{d.summery eq true}" style="font-weight: bold;">
                        <f:convertNumber pattern="#,##0.00"/>
                    </h:outputLabel>

                </p:column>
                <p:columnGroup type="footer">
                    <p:row>
                        <p:column colspan="5" footerText="Total OPD Service Collection"/>
                        <p:column style="text-align: right;" footerText="#{bookKeepingSummery.opdHospitalTotal}" >
                            <f:facet name="footer">
                                <h:outputLabel value="#{bookKeepingSummery.opdHospitalTotal}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputLabel>
                            </f:facet>
                        </p:column>
                    </p:row>
                </p:columnGroup>


            </p:dataTable> 

            
        </h:form>
    </ui:define>


</ui:composition>
